<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>Essential Links</h2>
    <ul>
      <li>
        <input type="text" v-model="username">
      </li>
      <li>
        <input type="password" v-model="password">
      </li>
    </ul>
    <a @click="login">登录</a>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: '登录页面',
      username: '',
      password: ''
    }
  },
  methods: {
    login: function () {
         axios({
         url: '/admin/Login/login',
         method: 'post',
          baseURL: '/api',
         data: {'username': this.username, 'password': this.password}
      })
         .then(function (response) {
            console.log(response)
        })
      }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}

</style>
